/*AR Values*/
preserve
collapse rvj illiq cojump, by(trend)
tsset trend
corrgram rvj , lags(5)
corrgram illiq , lags(5)
corrgram cojump , lags(5)
restore

preserve
keep if RATING == 1
collapse rvj illiq, by(trend)
tsset trend
corrgram rvj , lags(5)
corrgram illiq , lags(5)
restore

preserve
keep if RATING == 2
collapse rvj illiq, by(trend)
tsset trend
corrgram rvj , lags(5)
corrgram illiq , lags(5)
restore

preserve
keep if RATING == 3
collapse rvj illiq, by(trend)
tsset trend
corrgram rvj , lags(5)
corrgram illiq , lags(5)
restore

preserve
keep if RATING == 4
collapse rvj illiq, by(trend)
tsset trend
corrgram rvj , lags(5)
corrgram illiq , lags(5)
restore

* ----- Portfolios ---- *
preserve
sort rjv
gen portfolio = int((mod(_n-1, 13200))/3300) +1

bys portfolio: su returns
bys portfolio: su returns1
restore